#!/usr/bin/env python
# coding: utf8

from gluon import *
import re

# collection of utility functions:

# reurn a list of urls inside a text:

def get_ulrs(text):
    
    """ Extract all URL's from a string & return as a list """

    reg_exp = r'http[s]?://[^\s<>"]+|www\.[^\s<>"]+'
    
    url_list = re.findall(reg_exp,text)
    return url_list

def get_hashtags(text):

    reg_exp = '#\\w+'

    return re.findall(reg_exp,text)
